<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of MetricsController
 *
 * @author QuangKhoi
 */
class MetricsController {

    //put your code here
    public $model;

    /**
     *
     * @var MetricsView
     */
    public $view;

    public function __construct($model, $view) {
        $this->model = $model;
        $this->view = $view;
    }

    /**
     * 
     * @param Filter $stream
     */
    public function render($filter) {
        //Create NuSOAP client
        //Param parser
        #remove the directory path we don't want 
        $url = $_SERVER['REQUEST_URI'];
        $request = ltrim($url, '/');
        if (strpos($request, '?') != '') {
            $request = substr($request, 0, strpos($request, "?"));
        }
        #split the path by '/'
        $params = split("/", $request);
        $error = '';
        if (strtoupper($params[2]) != 'VIEWPORT') {
            
        }
        $streamView = new StreamView();
        $streamView->model = Stream::withId($filter["streamId"]);
        $masterView = MasterView::getInstance();
        $masterView->metrics = $this->model;
        $masterView->streamView = $streamView;

        $masterView->metricsView = $this->view;
    }

}

?>
